package com.ssy.lingxi.member.merchant.api.model.vo.paas;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 新增会员注册资料接口参数
 * @author 万宁
 * @date 2020-05-29
 * @version 2.0.0
 */
public class MemberConfigVO implements Serializable {

    private static final long serialVersionUID = 792276043755220548L;

    /**
     * 新增会员资料配置
     */
    public interface Add {}

    /**
     * 更新会员资料配置
     */
    public interface Update {}

    /**
     * 设置会员资料配置的状态
     */
    public interface UpdateStatus {}

    /**
     * 删除会员资料配置
     */
    public interface Delete {}

    /**
     * 设置会员资料配置的检验规则
     */
    public interface UpsertRules {}

    /**
     * 查询会员资料配置的检验规则
     */
    public interface GetRules {}

    /**
     * 会员Id，如果为0或空则新增，否则进行修改
     */
    @NotNull(message = "id要大于0", groups = {Update.class, UpdateStatus.class, Delete.class, UpsertRules.class, GetRules.class})
    @Positive(message = "id要大于0", groups = {Update.class, UpdateStatus.class, Delete.class, UpsertRules.class, GetRules.class})
    private Long id;

    /**
     * 字段名称
     */
    @NotEmpty(message = "字段名称不能为空", groups = {Add.class, Update.class})
    @Size(max = 26, message = "字段名称最长26个字符", groups = {Add.class, Update.class})
    private String fieldName;

    /**
     * 中文名称
     */
    @NotEmpty(message = "中文名称不能为空", groups = {Add.class, Update.class})
    @Size(max = 30, message = "中文名称最长30个字符", groups = {Add.class, Update.class})
    private String fieldLocalName;

    /**
     * 字段类型
     */
    @NotEmpty(message = "字段类型不能为空", groups = {Add.class, Update.class})
    private String fieldType;

    /**
     * 字段长度
     */
    @Min(value = 1, message = "字段长度要大于1", groups = {Add.class, Update.class})
    private int fieldLength;

    /**
     * 是否允许为空
     */
    @Min(value = 0, message = "'是否允许为空'的值为 0-否 1-是", groups = {Add.class, Update.class})
    @Max(value = 1, message = "'是否允许为空'的值为 0-否 1-是", groups = {Add.class, Update.class})
    private int fieldEmpty;

    /**
     * 分组名称
     */
    @NotBlank(message = "分组名称不能为空", groups = {Add.class, Update.class})
    private String groupName;

    /**
     * 排序
     */
    @Min(value = 1, message = "字段排序要大于1", groups = {Add.class, Update.class})
    private int fieldOrder;

    /**
     * 字段状态： 0-停用 1-启用
     */
    @Min(value = 0, message = "状态取值: 0-停用 1-启用", groups = UpdateStatus.class)
    @Max(value = 1, message = "状态取值: 0-停用 1-启用", groups = UpdateStatus.class)
    private int fieldStatus;

    /**
     * 帮助信息
     */
    @Size(max = 128, message = "帮助信息最长128个字符", groups = {Add.class, Update.class})
    private String fieldRemark;

    /**
     * 标签枚举
     */
    private Integer tagEnum;

    /**
     * 字段类型附加属性
     */
    private Map<String, Object> attr;

    /**
     * 校验规则枚举
     */
    private Integer ruleEnum;

    /**
     * 变更是否需要审核
     */
    private Integer validate;

    /**
     * 下拉框字段枚举值
     */
    private List<MemberConfigLabelVO> fieldEnum;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFieldLocalName() {
        return fieldLocalName;
    }

    public void setFieldLocalName(String fieldLocalName) {
        this.fieldLocalName = fieldLocalName;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public int getFieldLength() {
        return fieldLength;
    }

    public void setFieldLength(int fieldLength) {
        this.fieldLength = fieldLength;
    }

    public int getFieldEmpty() {
        return fieldEmpty;
    }

    public void setFieldEmpty(int fieldEmpty) {
        this.fieldEmpty = fieldEmpty;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public int getFieldOrder() {
        return fieldOrder;
    }

    public void setFieldOrder(int fieldOrder) {
        this.fieldOrder = fieldOrder;
    }

    public int getFieldStatus() {
        return fieldStatus;
    }

    public void setFieldStatus(int fieldStatus) {
        this.fieldStatus = fieldStatus;
    }

    public String getFieldRemark() {
        return fieldRemark;
    }

    public void setFieldRemark(String fieldRemark) {
        this.fieldRemark = fieldRemark;
    }

    public Integer getTagEnum() {
        return tagEnum;
    }

    public void setTagEnum(Integer tagEnum) {
        this.tagEnum = tagEnum;
    }

    public Map<String, Object> getAttr() {
        return attr;
    }

    public void setAttr(Map<String, Object> attr) {
        this.attr = attr;
    }

    public Integer getRuleEnum() {
        return ruleEnum;
    }

    public void setRuleEnum(Integer ruleEnum) {
        this.ruleEnum = ruleEnum;
    }

    public Integer getValidate() {
        return validate;
    }

    public void setValidate(Integer validate) {
        this.validate = validate;
    }

    public List<MemberConfigLabelVO> getFieldEnum() {
        return fieldEnum;
    }

    public void setFieldEnum(List<MemberConfigLabelVO> fieldEnum) {
        this.fieldEnum = fieldEnum;
    }
}
